from race.Player import *
import logging.config
from threading import Thread

logging.config.fileConfig('./util/logging.conf')
log = logging.getLogger("example")

"""
    子类描述：
        1、增强萨满类
"""


class EnhanceShaman(Player):

    ###############################################################
    # 增强萨满
    ###############################################################
    def on_keyboard_press_son_before_thread(self, key):
        log.debug("on_keyboard_press_son_before_thread 1:进入了函数")
        # 有些按键是直接终止别人的，继续自己的，有些不是这样的，因此要区别对待【排列组合，情况非常多】/【也要超级符合每个职业的操作习惯】
        if key in (
                Key.f1, Key.f2, Key.f3, Key.f4, Key.f5, Key.f6, Key.f7, Key.f8, Key.f9, Key.f10, Key.f11,
                Key.f12):
            pass
        elif key == Key.enter:
            pass
        elif key == Key.space:
            pass
        elif key == Key.alt_l:
            pass
        elif key == Key.ctrl_l:
            pass
        elif key == Key.caps_lock:
            pass
        elif key == Key.shift_l:
            pass
        elif key.char == 'a':
            # 不终止别人，后面让只允许一个线程执行的逻辑来顺序排
            # ★★★★★★|★★★★★★|★★★★★★|★★★★★★|★★★★★★|★★★★★★|★★★★★★|★★★★★★|★★★★★★|★★★★★★|
            # 并行并发执行的折中方案【通过触发其他按键，这样的好处是线程池统一管理了】
            pass
        elif key.char == 'z':
            pass
        elif key.char == 'q':
            pass
        elif key.char == 'w':
            # 终止掉别人
            self.interruptAllByForce()
        elif key.char == 'r':
            # 终止掉别人
            # interruptAllByForce()
            pass
        elif key.char == 'g':
            # 终止掉别人
            self.interruptAllByForce()
        elif key.char == 'x':
            # 终止掉别人
            self.interruptAllByForce()
        elif key.char == 'v':
            # 终止掉别人
            self.interruptAllByForce()
        elif key.char == 'h':
            # 终止掉别人
            self.interruptAllByForce()
        elif key.char == 'c':
            # 终止掉别人
            self.interruptAllByForce()
        elif key.char == 'e':
            pass
        elif key.char == 's':
            pass
        elif key.char == 'd':
            pass
        elif key.char == 'f':
            pass
        elif key.char == 'b':
            pass
        return

    def a(self):
        # 父类的方法先执行（或者后续看看是不是就直接用之类覆盖之后的方法）
        self.startScheduler1()  # 调用 CallBackScheduler1
        self.startScheduler2()  # 调用 CallBackScheduler2
        self.startScheduler3()  # 调用 CallBackScheduler3
        self.startScheduler4()  # 调用 CallBackScheduler4
        # self.startScheduler5()  # 调用 CallBackScheduler5
        # self.startScheduler6()  # 调用 CallBackScheduler6
        # self.startScheduler7()  # 调用 CallBackScheduler7 # 测试win32方式的画线，画矩形（内存监控）
        return

    def CallBackScheduler1(self):
        while self.ui.stopLoop == False:
            self.click(self.kb, '3', 3)
            sleep(0.1)
            self.click(self.kb, '4', 3)
            sleep(0.1)
            self.click(self.kb, '9', 3)
            sleep(0.1)
            self.click(self.kb, 'k', 2)

    def CallBackScheduler2(self):
        while self.ui.stopLoop == False:
            # 熔岩猛击
            self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X9, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                              self.WABloodBarDeltaY,
                                              self.WA_SQUARE_ZFX_AvgColor,
                                              self.RED, 'small', '2', 0.06, 4, self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            # 烈焰震击dot
            self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X2, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                              self.WABloodBarDeltaY,
                                              self.WA_SQUARE_ZFX_AvgColor,
                                              self.RED, 'small', '6', 0.06, 4, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

    def CallBackScheduler3(self):
        while self.ui.stopLoop == False:
            avgColor1 = self.pubAvgColorNoTrigger(self.WABloodBarX + self.WABloodBarWidth * 0.5, self.WABloodBarY - 4,
                                                  5,
                                                  5,
                                                  self.GREEN, 0)
            if avgColor1 < self.WABloodBarAvgColor:
                # 加血
                self.click(self.kb, '0', 4)
            else:
                # 加攻击
                # 满5层漩涡值，法术免费，并且变成了瞬发(资源要么用于加血，要么用于加攻击力)
                self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X1, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                                  self.WABloodBarDeltaY,
                                                  self.WA_SQUARE_ZFX_AvgColor,
                                                  self.GREEN, 'big', '7', 0.06, 4, self.ELSEKEY_1 ,self.DEBUG_CLOSE)

    def CallBackScheduler4(self):
        while self.ui.stopLoop == False:
            # 风暴打击
            self.click(self.kb, '1', 4)
            sleep(0.2)
            self.click(self.kb, '5', 5)
            sleep(0.2)

    def on_mouse_click_son_before_thread(self, x, y, button, pressed):
        # self.interruptAllByForce()
        pass
        return

    def mouseUp(self, x, y):
        log.debug('★鼠标向上滚，需要开始执行的内容★')
        for i in range(1, 20):
            self.click(self.kb, 'l', 2)
            sleep(0.1)
        log.debug('★鼠标向上滚，需要over执行的内容★')
        return

    def mouseDown(self, x, y):
        for i in range(1, 20):
            self.click(self.kb, 'l', 2)
            sleep(0.1)
        return

    def space(self):
        if self.ui.checkBox_SM_Jump2Wolf.isChecked() == True:
            self.click(self.kb, '.', 3)
        return

    def x(self):
        for i in range(1, 6):
            self.click(self.kb, Key.f10, 3)
            sleep(0.1)

        # 打断后的继续
        self.click(self.kb, 'a', 1)
        return

    def q(self):
        self.click(self.kb, 'o', 2)
        return

    def w(self):
        for i in range(1, 6):
            self.click(self.kb, Key.f6, 3)
            sleep(0.1)

        # 打断后的继续
        self.click(self.kb, 'a', 1)
        return

    def z(self):
        # 直接终止一切鼠标，键盘动作。
        self.stopLoop = True
        self.interruptAllByForce()
        return

###############################################################
# 奶萨。治疗萨满
###############################################################
class HealShaman(Player):

    def mouseUp(self, x, y):
        # 向上拉，链子，拉团血
        self.ui.stopLoop = True
        sleep(0.1)
        self.ui.stopLoop = False
        # self.stopScheduler3()
        self.startScheduler1()  # 调用 CallBackScheduler1

        self.startTiggerHP100_90()
        self.startTiggerHP90_80()
        self.startTiggerHP80_70()
        self.startTiggerHP70_60()
        self.startTiggerHP60_50()
        self.startTiggerHP50_40()
        self.startTiggerHP40_30()
        return

    def mouseDown(self, x, y):
        # 向下，球，治疗之涌，单体，站不稳
        self.ui.stopLoop = True
        sleep(0.1)
        self.ui.stopLoop = False
        # self.startScheduler2()
        # self.stopScheduler1()
        self.startScheduler3()  # 调用 CallBackScheduler3
        self.startTiggerHP100_90()
        self.startTiggerHP90_80()
        self.startTiggerHP80_70()
        self.startTiggerHP70_60()
        self.startTiggerHP60_50()
        self.startTiggerHP50_40()
        self.startTiggerHP40_30()
        # self.startScheduler4()  # 调用 CallBackScheduler4
        return

    def CallBackHP100_90(self):
        while self.ui.stopLoop == False:
            # 有两个buffer先要用掉
            #self.click(self.kb, Key.f12, 10)
            sleep(0.2)
            #self.click(self.kb, Key.f11, 6)
            sleep(0.2)

    def CallBackHP90_80(self):
        while self.ui.stopLoop == False:
            # 团本饰品1
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.9, self.WABloodBarY,
                                                  self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', 'm', 0.15, 2,
                                                  self.ELSEKEY_NONE, self.DEBUG_CLOSE)
            sleep(0.2)

            # 自然迅捷瞬发
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.8, self.WABloodBarY,
                                                  self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', Key.f11, 0.15, 2,
                                                  self.ELSEKEY_NONE, self.DEBUG_CLOSE)
            sleep(0.2)

    def CallBackHP80_70(self):
        while self.ui.stopLoop == False:
            # ★★★治疗之潮图腾★★★
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.7, self.WABloodBarY,
                                                  self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', Key.f3, 0.15, 2,
                                                  self.ELSEKEY_NONE, self.DEBUG_CLOSE)
            sleep(0.2)
            # 石壁图腾
            self.pubAvgColorTiggerKeyBloodBarMode(self.WAMagicBarX + self.WAMagicBarWidth * 0.7, self.WAMagicBarY,
                                                  self.WAMagicBarDeltaX, self.WAMagicBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', 'i', 0.15, 2,
                                                  self.ELSEKEY_NONE, self.DEBUG_CLOSE)
            sleep(0.2)

    def CallBackHP70_60(self):
        while self.ui.stopLoop == False:
            sleep(2.1)
            pass

    def CallBackHP60_50(self):
        while self.ui.stopLoop == False:
            # 星界转移盾
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.5, self.WABloodBarY,
                                                  self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', Key.f11, 0.15, 2,
                                                  self.ELSEKEY_NONE, self.DEBUG_CLOSE)
            sleep(0.2)
            # 昇腾加力
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.65, self.WABloodBarY,
                                                  self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', Key.f4, 0.15, 2,
                                                  self.ELSEKEY_NONE, self.DEBUG_CLOSE)
            sleep(0.2)

    def CallBackHP50_40(self):
        while self.ui.stopLoop == False:
            sleep(1.1)
            pass

    def CallBackHP40_30(self):
        while self.ui.stopLoop == False:
            # 先祖指引
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.4, self.WABloodBarY,
                                                  self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', Key.f12, 0.15, 2,
                                                  self.ELSEKEY_NONE, self.DEBUG_CLOSE)
            sleep(0.2)
            # 嗜血
            self.pubAvgColorTiggerKeyBloodBarMode(self.WABloodBarX + self.WABloodBarWidth * 0.3, self.WABloodBarY,
                                                  self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', Key.f8, 0.15, 2,
                                                  self.ELSEKEY_NONE, self.DEBUG_CLOSE)
            sleep(0.2)

    def CallBackScheduler2(self):
        # 判断5人本的血量情况，自动释放技能
        # self.click(self.kb, '0', 4)

        while self.ui.stopLoop == False:
            log.info('查看评率查看评率查看评')

            # log.info(self.WABloodBarX + self.WABloodBarWidth * 0.2)
            # log.info(self.WABloodBarY + self.WABloodBarGap1InY)
            # log.info(self.WABloodBarDeltaX)
            # log.info(self.WABloodBarDeltaY)
            # # 判断5人本的血量情况，自动释放技能
            # # # 保证自己是已经把坦克血量的焦点弄出来了，才有下面的逻辑
            # avgColorNumberFocusTankIsExist0 = self.pubAvgColorNoTrigger(self.WABloodBarX + self.WABloodBarWidth * 0.3,
            #                                                             self.WABloodBarY + self.WABloodBarGap1InY,
            #                                                             self.WABloodBarDeltaX,
            #                                                             self.WABloodBarDeltaY,
            #                                                             self.RED, 0.08)
            # avgColorNumberFocusTankIsExist1 = self.pubAvgColorNoTrigger(self.WABloodBarX + self.WABloodBarWidth * 0.4,
            #                                                             self.WABloodBarY + self.WABloodBarGap1InY,
            #                                                             self.WABloodBarDeltaX,
            #                                                             self.WABloodBarDeltaY,
            #                                                             self.GREEN, 0.08)
            # avgColorNumberFocusTankIsExist2 = self.pubAvgColorNoTrigger(self.WABloodBarX + self.WABloodBarWidth * 0.6,
            #                                                             self.WABloodBarY + self.WABloodBarGap1InY,
            #                                                             self.WABloodBarDeltaX,
            #                                                             self.WABloodBarDeltaY,
            #                                                             self.GREEN, 0.08)
            # if avgColorNumberFocusTankIsExist1 < self.WABloodBarAvgColor:
            #     self.click(self.kb, Key.f8, 4)
            #     sleep(0.1)
            # if avgColorNumberFocusTankIsExist0 > self.WABloodBarAvgColor:
            #     # 保证自己是已经把坦克血量的焦点弄出来了，才有下面的逻辑
            #     TiggerPoint = 0.7
            #     avgColorNumberMyself = self.pubAvgColorNoTrigger(self.WABloodBarX + self.WABloodBarWidth * TiggerPoint,
            #                                                      self.WABloodBarY,
            #                                                      self.WABloodBarDeltaX,
            #                                                      self.WABloodBarDeltaY, self.GREEN, 0.08)
            #
            #     avgColorNumberFocusTank = self.pubAvgColorNoTrigger(
            #         self.WABloodBarX + self.WABloodBarWidth * TiggerPoint,
            #         self.WABloodBarY + self.WABloodBarGap1InY,
            #         self.WABloodBarDeltaX,
            #         self.WABloodBarDeltaY, self.GREEN, 0.08)
            #     if avgColorNumberMyself < self.WABloodBarAvgColor and avgColorNumberFocusTank < self.WABloodBarAvgColor:
            #         # self.pubAvgColorTiggerKeyCDMode(135, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
            #         #                                 self.WA_SQUARE_ZFX_AvgColor,
            #         #                                 self.GREEN, 'big', ',', 0.06, 2 ,self.DEBUG_CLOSE)
            #         self.click(self.kb, Key.f3, 4)
            #         sleep(0.1)
            #         TiggerPoint = 0.5
            #         avgColorNumberMyself = self.pubAvgColorNoTrigger(
            #             self.WABloodBarX + self.WABloodBarWidth * TiggerPoint, self.WABloodBarY,
            #             self.WABloodBarDeltaX,
            #             self.WABloodBarDeltaY, self.GREEN, 0.08)
            #         if avgColorNumberMyself < self.WABloodBarAvgColor:
            #             self.click(self.kb, Key.f6, 4)
            #             sleep(0.1)
            #     else:
            #         sleep(0.1)
            # else:
            #     # self.click(self.kb, Key.f4, 4)
            #     # sleep(0.1)
            #     pass

    def CallBackScheduler4(self):
        # while self.ui.stopLoop == False:
        while self.ui.stopLoop == False:
            # 暴雨图腾
            self.pubAvgColorTiggerKeyCDMode(18, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.GREEN, 'big', '3', 0.06, 2 ,self.ELSEKEY_1,self.DEBUG_CLOSE)
            # 大地之墙图腾
            # self.pubAvgColorTiggerKeyCDMode(96, self.WA_SQUARE_ZFX, 10, 10, self.WA_SQUARE_ZFX_AvgColor, self.RED, 'big', '5', 0.1, 2 ,self.DEBUG_CLOSE)
            # # 法力图腾
            self.pubAvgColorTiggerKeyCDMode(1430, self.WABloodBarY, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                            self.WABloodBarAvgColor,
                                            self.GREEN, 'big', 'i', 0.06, 2 ,self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            # # 土元素(焦点血量低于)
            # self.pubAvgColorTiggerKeyCDMode(500, 1036, self.WABloodBarDeltaX, self.WABloodBarDeltaY, self.WABloodBarAvgColor,
            #                                 self.GREEN, 'big', 't', 0.1, 2 ,self.DEBUG_CLOSE)
            # 暮钟图腾
            # self.pubAvgColorTiggerKeyCDMode(1340, 1037, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
            #                                 self.WA_SQUARE_ZFX_AvgColor,
            #                                 self.GREEN, 'big', '6', 0.1, 3 ,self.DEBUG_CLOSE)
            # 收割链(节约用，不能随意触发)
            avgColorNumber = self.pubAvgColorNoTrigger(500, self.WABloodBarY, self.WABloodBarDeltaX + 7,
                                                       self.WABloodBarDeltaY, self.GREEN, 0.06)
            if avgColorNumber < self.WABloodBarAvgColor:
                self.pubAvgColorTiggerKeyCDMode(135, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                self.WA_SQUARE_ZFX_AvgColor,
                                                self.GREEN, 'big', ',', 0.06, 2 ,self.ELSEKEY_1,self.DEBUG_CLOSE)

            # 血量低于xx多少，触发开启饰品
            self.pubAvgColorTiggerKeyBloodBarMode(523, self.WABloodBarY, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', ';', 0.06, 2, self.ELSEKEY_NONE, self.DEBUG_CLOSE)

            # 血量低于xx多少，触发开启灵魂链接图腾
            self.pubAvgColorTiggerKeyBloodBarMode(470, self.WABloodBarY, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', '=', 0.06, 2, self.ELSEKEY_NONE, self.DEBUG_CLOSE)

            # 血量低于xx多少，触发土元素
            self.pubAvgColorTiggerKeyBloodBarMode(480, self.WABloodBarY, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', 't', 0.06, 2, self.ELSEKEY_NONE, self.DEBUG_CLOSE)

            # 蓝量低于多少，开启法力图腾
            self.pubAvgColorTiggerKeyBloodBarMode(1400, self.WABloodBarY, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.GREEN, 'small', 'i', 0.06, 2, self.ELSEKEY_NONE, self.DEBUG_CLOSE)

            # 血量低于xx多少，触发升腾
            self.pubAvgColorTiggerKeyBloodBarMode(450, self.WABloodBarY, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.RED, 'small', 'o', 0.06, 2, self.ELSEKEY_NONE, self.DEBUG_CLOSE)

            # 血量低于xx多少，吃术士糖
            self.pubAvgColorTiggerKeyBloodBarMode(500, self.WABloodBarY, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                                  self.WABloodBarAvgColor, self.RED, 'small', '-', 0.06, 2, self.ELSEKEY_NONE, self.DEBUG_CLOSE)

            # 焦点坦克血量（首先要有底部的血，怕自己忘记设置T为焦点而失误放出技能）
            avgColorNumber = self.pubAvgColorNoTrigger(420, self.WABloodBarY - self.WABlood1_Blood2_DeltaY,
                                                       self.WABloodBarDeltaX + 7,
                                                       self.WABloodBarDeltaY, self.RED, 0.06)
            if avgColorNumber > self.WABloodBarAvgColor:
                # *******************进入这里，才说明了设置坦克为焦点，才会触发对坦克血量判断的逻辑*******************
                # 焦点坦克血量低于xx多少，触发开启饰品
                self.pubAvgColorTiggerKeyBloodBarMode(523, self.WABloodBarY - self.WABlood1_Blood2_DeltaY,
                                                      self.WABloodBarDeltaX,
                                                      self.WABloodBarDeltaY,
                                                      self.WABloodBarAvgColor, self.RED, 'small', ';', 0.06, 2, self.ELSEKEY_NONE, self.DEBUG_CLOSE)

                # 焦点坦克血量低于xx多少，触发土元素
                self.pubAvgColorTiggerKeyBloodBarMode(500, self.WABloodBarY - self.WABlood1_Blood2_DeltaY,
                                                      self.WABloodBarDeltaX,
                                                      self.WABloodBarDeltaY,
                                                      self.WABloodBarAvgColor, self.RED, 'small', 't', 0.06, 2, self.ELSEKEY_NONE, self.DEBUG_CLOSE)

                # $$$$$$$$$$$$$$$$焦点坦克的血和自己奶萨的血，都低于多少的时候，触发灵魂链接图腾$$$$$$$$$$$$$$$$ #
                avgColorNumberTank = self.pubAvgColorNoTrigger(466, self.WABloodBarY - self.WABlood1_Blood2_DeltaY,
                                                               self.WABloodBarDeltaX + 7,
                                                               self.WABloodBarDeltaY, self.RED, 0.06)
                avgColorNumberMe = self.pubAvgColorNoTrigger(466, self.WABloodBarY - self.WABlood1_Blood2_DeltaY,
                                                             self.WABloodBarDeltaX + 7,
                                                             self.WABloodBarDeltaY, self.RED, 0.06)
                if avgColorNumberTank < self.WABloodBarAvgColor and avgColorNumberMe < self.WABloodBarAvgColor:
                    for i in range(1, 3):
                        # 灵魂链接图腾
                        self.click(self.kb, Key.f6, 3)
                        sleep(0.1)

                # $$$$$$$$$$$$$$$$焦点坦克的血和自己奶萨的血，都低于多少的时候，触发灵魂链接图腾$$$$$$$$$$$$$$$$ #
                # +7是应为血条长一点，平均下来，避免色差
                avgColorNumberTank = self.pubAvgColorNoTrigger(500, self.WABloodBarY - self.WABlood1_Blood2_DeltaY,
                                                               self.WABloodBarDeltaX + 7,
                                                               self.WABloodBarDeltaY, self.RED, 0.06)
                # +7是应为血条长一点，平均下来，避免色差
                avgColorNumberMe = self.pubAvgColorNoTrigger(500, self.WABloodBarY - self.WABlood1_Blood2_DeltaY,
                                                             self.WABloodBarDeltaX + 7,
                                                             self.WABloodBarDeltaY, self.RED, 0.06)
                if avgColorNumberTank < self.WABloodBarAvgColor and avgColorNumberMe < self.WABloodBarAvgColor:
                    for i in range(1, 3):
                        # 升腾
                        self.click(self.kb, Key.f4, 3)
                        sleep(0.1)
            else:
                # 忘记设置焦点，或者坦克立刻就要空血
                pass

    def CallBackScheduler1(self):
        ################################################### AOE,拉团血（★★★★★主要★★★★★）
        # 治疗之泉水(暴雨)
        self.click(self.kb, '0', 4)

        while self.ui.stopLoop == False:
            log.info('ddddddddddddddddddddddd777227772277722777227772277722')
            # # 收割链
            # self.pubAvgColorTiggerKeyCDMode(135, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
            #                                 self.WA_SQUARE_ZFX_AvgColor,
            #                                 self.RED, 'big', ',', 0.1, 4 ,self.DEBUG_CLOSE)
            # # 有两个buffer先要用掉
            # self.click(self.kb, Key.f12, 2)
            # sleep(0.1)
            # self.click(self.kb, Key.f11, 2)
            # 激流
            self.click(self.kb, '8', 4)
            sleep(0.1)
            # 治疗链
            self.click(self.kb, '1', 10)
            self.click(self.kb, ']', 2)

    def CallBackScheduler3(self):
        ################################################### 非AOE,拉单血（★★★★★主要★★★★★）
        # 治疗之泉水(暴雨)
        self.click(self.kb, '0', 4)

        # 父类的方法先执行（或者后续看看是不是就直接用之类覆盖之后的方法）
        while self.ui.stopLoop == False:
            # # 有两个buffer先要用掉
            # self.click(self.kb, Key.f12, 2)
            # sleep(0.1)
            # self.click(self.kb, Key.f11, 2)
            # 激流
            self.click(self.kb, '8', 4)
            sleep(0.1)
            # 生命释放
            # self.pubAvgColorTiggerKeyCDMode(57, self.WA_SQUARE_ZFX, 10, 10, self.WA_SQUARE_ZFX_AvgColor, self.RED, 'big', '4', 0.1, 2 ,self.DEBUG_CLOSE)
            # 治疗之涌
            self.click(self.kb, '3', 6)

    def CallBackScheduler5(self):
        ################################################### 卡CD用,单体和AOE，都要卡的

        # 父类的方法先执行（或者后续看看是不是就直接用之类覆盖之后的方法）
        while self.ui.stopLoop == False:
            # 有两个buffer先要用掉
            self.click(self.kb, Key.f12, 10)
            sleep(0.2)
            self.click(self.kb, Key.f11, 6)
            sleep(0.2)

    def a(self):

        # while self.ui.stopLoop == False:
        while self.ui.stopLoop == False:
            # 打输出（官方一键宏）
            self.click(self.kb, 'k', 4)
            sleep(0.2)

    def on_mouse_scroll_son_before_thread(self, dx, dy):
        if dy < 0:
            # 滚轮向下
            self.interruptAllByForceMouseUpDown()  # 强制打断正在运行的循环
        elif dy > 0:
            # 滚轮向上
            self.interruptAllByForceMouseUpDown()  # 强制打断正在运行的循环
        return

    def space(self):
        # 跳的时候，是根据界面的变量来决定是否同时变狼的
        if self.ui.checkBox_SM_Jump2Wolf.isChecked() == True:
            self.click(self.kb, '.', 3)
        return

    def q(self):
        # 大地之盾
        self.click(self.kb, 't', 6)
        return

    def r(self):
        # while self.ui.stopLoop == False:
        while self.ui.stopLoop == False:
            # 暴雨图腾
            self.pubAvgColorTiggerKeyCDMode(18, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.RED, 'big', '3', 0.1, 2 , self.ELSEKEY_1,self.DEBUG_CLOSE)
            # sleep(0.1)
            self.click(self.kb, '2', 3)
            self.pubAvgColorTiggerKeyCDMode(57, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.RED, 'big', '4', 0.1, 2 , self.ELSEKEY_1,self.DEBUG_CLOSE)
            # sleep(0.1)
            self.click(self.kb, '1', 4)
            # sleep(0.1)
            self.pubAvgColorTiggerKeyCDMode(96, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.RED, 'big', '5', 0.1, 2 ,self.ELSEKEY_1 ,self.DEBUG_CLOSE)
            self.pubAvgColorTiggerKeyCDMode(1340, 1037, self.WABloodBarDeltaX, self.WABloodBarDeltaY,
                                            self.WA_SQUARE_ZFX_AvgColor,
                                            self.RED, 'big', '6', 0.1, 2 , self.ELSEKEY_1,self.DEBUG_CLOSE)

    def mouseRightClick(self, x, y):
        log.debug('★治疗SM鼠标click-right，需要开始执行的内容★')
        return

    def parallelAlt2(self):
        # 父类的方法先执行（或者后续看看是不是就直接用之类覆盖之后的方法）
        while self.ui.stopLoop == False:
            # sleep(0.01)
            # self.click(self.kb, 't', 3)
            # sleep(0.01)
            sleep(1)
            pass

    def w(self):
        for i in range(1, 4):
            # 星界转移
            self.click(self.kb, 'p', 2)
            sleep(0.1)

        # 打断后的继续
        self.click(self.kb, 'a', 1)
        return

    def x(self):
        for i in range(1, 4):
            self.click(self.kb, '\\', 2)
            sleep(0.1)

        # 打断后的继续
        self.click(self.kb, 'r', 1)
        return

    def c(self):
        for i in range(1, 4):
            self.click(self.kb, '[', 2)
            sleep(0.1)

        # 打断后的继续
        self.click(self.kb, 'a', 1)
        return

    def CallBackScheduler5(self):
        # 父类的方法先执行（或者后续看看是不是就直接用之类覆盖之后的方法）
        while self.ui.stopLoop == False:
            # 激流
            self.click(self.kb, ';', 2)
            sleep(0.2)
            # 生命释放
            # self.pubAvgColorTiggerKeyCDMode(57, self.WA_SQUARE_ZFX, 10, 10, self.WA_SQUARE_ZFX_AvgColor, self.RED, 'big', '4', 0.1, 2 ,self.DEBUG_CLOSE)
            # 治疗之涌
            self.click(self.kb, '=', 4)

    def v(self):
        # 治疗的同时还需要打伤害
        # while self.ui.stopLoop == False:
        #     # 激流
        #     self.click(self.kb, ';', 2)
        #     sleep(0.2)
        #     # 生命释放
        #     # self.pubAvgColorTiggerKeyCDMode(57, self.WA_SQUARE_ZFX, 10, 10, self.WA_SQUARE_ZFX_AvgColor, self.RED, 'big', '4', 0.1, 2 ,self.DEBUG_CLOSE)
        #     # 治疗之涌
        #     self.click(self.kb, '=', 4)
        self.startScheduler5()  # 调用 CallBackScheduler5
        return

    def z(self):
        self.ui.stopLoop = True
        # sleep(0.1)
        # self.ui.stopLoop = False
        # 触发打断
        self.startScheduler6()
        return


    def CallBackScheduler6(self):
        # 用于补充打断法术
        for i in range(1, 3):
            self.ui.stopLoop = True
            # 打断
            self.click(self.kb, '\'', 1)
            sleep(0.5)
        return


###############################################################
# 电萨满皮卡丘
###############################################################
class ElementShaman(Player):
    # 电萨满皮卡丘
    def a(self):
        # 父类的方法先执行（或者后续看看是不是就直接用之类覆盖之后的方法）
        # super().a()

        # ★★★★★并行|并发★★★★★----------------parallel:`1   Alt2     cap3    shift4   ctrl5
        self.kb.press('`')  # 触发-->parallel1
        self.kb.release('`')

        self.kb.press(Key.alt_l)
        self.kb.release(Key.alt_l)
        #
        # self.kb.press(Key.caps_lock)
        # self.kb.release(Key.caps_lock)
        #
        # self.kb.press(Key.ctrl_l)
        # self.kb.release(Key.ctrl_l)

        while self.ui.stopLoop == False:
            # print('开始开始开始开始开始开始开始开始开始开始开始开始开始开始开始开始开始开始开始开始开始开始开始开始')
            sleep(0.4)

    def on_mouse_click_son_before_thread(self, x, y, button, pressed):
        # self.interruptAllByForce()
        pass
        return

    def mouseUp(self, x, y):
        self.startScheduler1()  # 调用 CallBackScheduler1
        self.startScheduler2()  # 调用 CallBackScheduler1
        self.startScheduler5()  # 调用 CallBackScheduler1
        return

    def mouseDown(self, x, y):
        self.startScheduler2()
        self.startScheduler3()  # 调用 CallBackScheduler3
        self.startScheduler4()  # 调用 CallBackScheduler4
        return

    def CallBackScheduler1(self):
        # AOE
        while self.ui.stopLoop == False:
            self.click(self.kb, '0', 10)
            sleep(0.15)
            self.click(self.kb, '1', 12)
            sleep(0.15)
            # 狂风怒号(AOE and not AOE)
            self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X3, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                              self.WABloodBarDeltaY,
                                              self.WA_SQUARE_ZFX_AvgColor,
                                              self.RED, 'big', '4', 0.06, 8, self.ELSEKEY_9, self.DEBUG_CLOSE)
    def CallBackScheduler2(self):
        # 父类的方法先执行（或者后续看看是不是就直接用之类覆盖之后的方法） AOE and NOT AOE
        while self.ui.stopLoop == False:
            sleep(0.1)
            # 狂风怒号(AOE and not AOE)
            self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X3, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                              self.WABloodBarDeltaY,
                                              self.WA_SQUARE_ZFX_AvgColor,
                                              self.RED, 'big', '4', 0.06, 8, self.ELSEKEY_9, self.DEBUG_CLOSE)
            # self.click(self.kb, '4', 2)
            sleep(0.1)
            self.click(self.kb, '3', 6)
            sleep(0.1)
            self.click(self.kb, '7', 2)
            sleep(0.1)
            self.click(self.kb, Key.f12, 2)
            sleep(0.1)
            # 冰怒1
            self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X1, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                              self.WABloodBarDeltaY,
                                              self.WA_SQUARE_ZFX_AvgColor,
                                              self.RED, 'big', '6', 0.06, 4, self.ELSEKEY_9, self.DEBUG_CLOSE)
            sleep(0.1)
            # 冰怒2
            self.pubAvgColorTiggerKeyBuffMode(self.WA_SQUARE_ZFX_X2, self.WA_SQUARE_ZFX, self.WABloodBarDeltaX,
                                              self.WABloodBarDeltaY,
                                              self.WA_SQUARE_ZFX_AvgColor,
                                              self.RED, 'big', '6', 0.06, 4, self.ELSEKEY_9, self.DEBUG_CLOSE)


    def CallBackScheduler3(self):
        # Not AOE
        while self.ui.stopLoop == False:
            self.click(self.kb, '3', 12)
            sleep(0.15)
            self.click(self.kb, '4', 8)
            sleep(0.15)
            self.click(self.kb, Key.f4, 6)
            sleep(0.15)
            self.click(self.kb, Key.f6, 6)

    def CallBackScheduler4(self):
        # Not AOE
        while self.ui.stopLoop == False:

            self.click(self.kb, '9', 12)
            sleep(0.15)

    def CallBackScheduler5(self):
        # AOE
        while self.ui.stopLoop == False:
            self.click(self.kb, Key.f3, 6)
            sleep(0.1)
            self.click(self.kb, Key.f4, 6)
            sleep(0.1)
            self.click(self.kb, Key.f5, 6)
            sleep(0.1)
            self.click(self.kb, Key.f6, 6)
            sleep(0.1)
            self.click(self.kb, '0', 12)
            sleep(0.1)


    def space(self):
        if self.ui.checkBox_SM_Jump2Wolf.isChecked() == True:
            self.click(self.kb, '.', 3)
        return

    def w(self):
        for i in range(1, 6):
            self.click(self.kb, 'p', 3)
            sleep(0.3)

        # 打断后的继续
        # self.click(self.kb, 'a', 1)
        return

    def q(self):
        for i in range(1, 6):
            self.click(self.kb, Key.f3, 3)
            sleep(0.3)
        return

    def x(self):
        for i in range(1, 6):
            self.click(self.kb, '[', 3)
            sleep(0.3)
        return

    def CallBackScheduler6(self):
        # 恶魔术士（切目标）
        while self.ui.stopLoop == False:
            self.click(self.kb, Key.tab, 1)
            sleep(5)
        return

    def v(self):
        self.startScheduler6()
        return

    def z(self):
        self.ui.stopLoop = True
        # sleep(0.1)
        # self.ui.stopLoop = False
        # 触发打断
        self.startScheduler7()
        return


    def CallBackScheduler7(self):
        # 用于补充打断法术
        for i in range(1, 3):
            self.ui.stopLoop = True
            # 打断
            self.click(self.kb, '\'', 1)
            sleep(0.5)
        return


if __name__ == '__main__':
    pass
